package io.wdb.wxapp.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import io.wdb.common.utils.PageUtils;
import io.wdb.common.utils.Query;
import io.wdb.common.utils.R;
import io.wdb.modules.activity.wxapp.entity.HdActivityEntity;
import io.wdb.modules.activity.wxapp.service.HdActivityService;

@Controller
@RequestMapping("wxapp/user")
public class UserController {
	@Autowired
	private HdActivityService hdActivityService;
	//获取用户验证码
	public R list(@RequestParam Map<String, Object> params){
		//查询列表数据
        Query query = new Query(params);
		List<HdActivityEntity> hdActivityList = hdActivityService.queryList(query);
		int total = hdActivityService.queryTotal(query);
		
		PageUtils pageUtil = new PageUtils(hdActivityList, total, query.getLimit(), query.getPage());
		
		return R.ok().put("page", pageUtil);
	}
}
